import moment from 'moment'

const lock_field = {
    "addDisplay": false,
    "addDisabled": false,
    "editDisplay": false,
    "editDisabled": true,
    "showColumn": false,
};
export const tableOption = {
    "border": true,
    "index": true,
    "indexLabel": "序号",
    "stripe": true,
    "menuAlign": "center",
    "align": "center",
    "searchMenuSpan": 6,
    "column": [{
        ...lock_field,
        "type": "input",
        "label": "编号",
        "prop": "shijianId",
    }, {
        ...lock_field,
        "type": "input",
        "label": "学籍号",
        "prop": "shijianStudent",
    }, {
        ...lock_field,
        "type": "input",
        "label": "学期编号",
        "prop": "shijianTerm",
        "hide": true,
    }, {
        ...lock_field,
        "type": "input",
        "label": "类别",
        "prop": "shijianCategory",
        "hide": true
    }, {
        ...lock_field,
        "type": "input",
        "label": "其它类别名称",
        "prop": "shijianOtherCategory",
        "hide": true
    }, {
        "type": "input",
        "label": "实践形式",
        "prop": "shijianModality",
        rules: [{ required: true, message: "必填内容，不能为空", trigger: "blur" }],
    }, {
        "type": "input",
        "label": "内容",
        "prop": "shijianContent",
        rules: [{ required: true, message: "必填内容，不能为空", trigger: "blur" }],
    }, {
        "type": "daterange",
        "label": "起止时间",
        "prop": "shijianDate",
        "format": "yyyy-MM-dd",
        "valueFormat": "yyyy-MM-dd 00:00:00",
        "value": [moment().format('YYYY-MM-DD 00:00:00'), moment().format('YYYY-MM-DD 00:00:00')],
        formatter: (row, value, label, column) => { return value.join(' 至 ').replace(/00:00:00/g, '') },
        rules: [{ required: true, message: "必填内容，不能为空", trigger: "blur" }],
    }, {
        "type": "input",
        "label": "承担任务",
        "prop": "shijianMyJob",
        rules: [{ required: true, message: "必填内容，不能为空", trigger: "blur" }],
    }, {
        "type": "input",
        "label": "实践成果",
        "prop": "shijianPositive",
        rules: [{ required: true, message: "必填内容，不能为空", trigger: "blur" }],
    }, {
        "type": "input",
        "label": "评价意见",
        "prop": "shijianOpinion",
        rules: [{ required: true, message: "必填内容，不能为空", trigger: "blur" }],
    }, {
        "type": "input",
        "label": "指导教师",
        "prop": "shijianInstructor",
        rules: [{ required: true, message: "必填内容，不能为空", trigger: "blur" }],
    }, {...lock_field,
        "type": "input",
        "label": "创建人",
        "prop": "shijianCreateUser",
    }, {
        ...lock_field,
        "type": "input",
        "label": "",
        "prop": "shijianCreateTime",
    }, {
        ...lock_field,
        "type": "input",
        "label": "审核人",
        "prop": "shijianApproveUser",
    }, {
        ...lock_field,
        "type": "input",
        "label": "",
        "prop": "shijianApproveTime",
    }],
    group: [{
        label: "附件",
        column: [{
            "type": "upload",
            "label": "附件",
            "prop": "attachment",
            "action": "/szpj/file/zp_shi_jian/upload",
            "data": { shijianCategory: "2" },
            "multiple": true,
        }],
    }],

}